package com.cosina.game.crystallight.ui.menu.transform;

import java.util.ArrayList;
import java.util.List;

import android.graphics.Canvas;
import android.graphics.Rect;

public class TransformSuite extends Transform{
	public List<Transform> transforms = new ArrayList<Transform>();

	public static final TransformSuite NULLSUITE = new TransformSuite();
	
	@Override
	public final void doT(Canvas canvas) {
		for(int i=transforms.size()-1; i>=0;i --){
				transforms.get(i).comeBack(canvas);
		}
	}

	@Override
	public final void undoT(Canvas canvas) {
		for(Transform transform : transforms){
			transform.undoT(canvas);
		}
	}

	@Override
	public void setOccpuy(Rect occpuy) {
		for(Transform each : transforms){
			each.setOccpuy(occpuy);
		}
	}

	public void buttonClick() {
		for(Transform each : transforms){
			each.buttonClick();
		}
	}

	
	public static TransformSuite create(Transform... newTransforms){
		TransformSuite ts = new TransformSuite();
		for(Transform each : newTransforms){
			ts.transforms.add(each);
		}
		return ts;
	}
	
	
	@Override
	public void update() {
		
	}
}
